from houses.utils.house_search import generate_housesearch_result


def generate_userhouse_result(request, data):
    """生成个人API需要的返回结果的辅助函数"""

    # 复用generate_housesearch_result来生成基本的结果
    result = generate_housesearch_result(request, data)

    # 删除字段“total_pages”
    result['data'].pop('total_pages')

    return result
